<?php
/*
    GUMUD is Extensible Web-based Multi-User Dungeon Software.

    Copyright (C) 2013  White Rabbit

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
$itx['config']['com-front'] = getLocalConfig("com-front");

$cxtpl = new XTemplate(pathprivate.'localization/'.$itx['user']['lang'].'/Components/com-inner/xtpl/'.$itx['script'].'.xtpl');
$itx['quecommand'] = "action~default";
/*
if (isset($_SESSION['quecommand'])) { $itx['quecommand'] = $_SESSION['quecommand']; }
$itx['com-inner'][1] = parseQueCommand($itx,$itx['quecommand']);*/
$itx['com-inner'][3] = file_get_contents("http://".gridURL."/index.php?scripthandshakeID=".scripthandshakeID."&request=getuser&firstname=".$itx['user']['avatarFirst']."&lastname=".$itx['user']['avatarLast']);
touchDAT($itx['com-inner'][3]);
updateChat($itx);
$xtpl->assign("response",addslashes(getResponseFile($itx,$itx['com-inner'][3])."<br><br><br><a id='PointObserve' name='PointObserve'></a>"));
$xtpl->assign("stats",addslashes(getStatsDisplay($itx['com-inner'][3])));
$xtpl->assign("inventory",addslashes(file_get_contents("http://".gridURL."/index.php?scripthandshakeID=".scripthandshakeID."&request=getInventory&firstname=".$itx['user']['avatarFirst']."&lastname=".$itx['user']['avatarLast'])));
$xtpl->assign("settings",addslashes(file_get_contents("http://".gridURL."/index.php?scripthandshakeID=".scripthandshakeID."&request=getSettings&firstname=".$itx['user']['avatarFirst']."&lastname=".$itx['user']['avatarLast'])));
$itx['tempexchangepage'] = file_get_contents("http://".gridURL."/index.php?scripthandshakeID=".scripthandshakeID."&request=getExchange&firstname=".$itx['user']['avatarFirst']."&lastname=".$itx['user']['avatarLast']);
$itx['tempexchangepage'] = str_replace("::wallet::",LANGstringWallet,$itx['tempexchangepage']);
$itx['tempexchangepage'] = str_replace("::lexical::",LANGstringLexical,$itx['tempexchangepage']);
$itx['tempexchangepage'] = str_replace("::gold::",LANGstringGold,$itx['tempexchangepage']);
$itx['tempexchangepage'] = str_replace("::mana::",LANGstringMana,$itx['tempexchangepage']);
$itx['tempexchangepage'] = str_replace("::walletx::",LANGstringWalletX,$itx['tempexchangepage']);
$itx['tempexchangepage'] = str_replace("::lexicalx::",LANGstringLexicalX,$itx['tempexchangepage']);
$itx['tempexchangepage'] = str_replace("::goldx::",LANGstringGoldX,$itx['tempexchangepage']);
$itx['tempexchangepage'] = str_replace("::manax::",LANGstringManaX,$itx['tempexchangepage']);
$xtpl->assign("exchange",addslashes($itx['tempexchangepage']));
touchInventoryDAT($itx['com-inner'][3]);
$xtpl->assign("inventoryresponse",addslashes(getInventoryResponseFile($itx,$itx['com-inner'][3])));
$itx['com-inner'][4] = file_get_contents("http://".gridURL."/index.php?scripthandshakeID=".scripthandshakeID."&request=getUserRegionLoc&uuid=".$itx['com-inner'][3]);
		$itx['com-inner'][5] = file_get_contents("http://".gridURL."/index.php?scripthandshakeID=".scripthandshakeID."&request=getRegionData&uuid=".$itx['com-inner'][4]);
		$array1 = splitData($itx['com-inner'][5]);
		$array2 = splitData(file_get_contents("http://".$array1[3]."/index.php?scripthandshakeID=".scripthandshakeID."&request=getLocalLoc&uuid=".$itx['com-inner'][3]));
$xtpl->assign("addy","<p>Current Location: ".$array1[4]."(".$array2[0].",".$array2[1].")</p>");


$cxtpl->assign("token",$token);
$cxtpl->parse("component");
$itx['block']['com'] = $cxtpl->iout("component");
$itx['page']['name'] = "Home";
?>
